export default class PopUp{
    constructor() {

    }
    show(){
        let popUp = document.createElement("div");
        popUp.setAttribute("id","popUp");
        popUp.setAttribute("id","popUp");
        document.body.append(popUp);
        //添加内容框
        let contentDiv = document.createElement("div");
        contentDiv.setAttribute("id", "contentDiv");
        //确认按钮
        let ok = document.createElement("input");
        ok.setAttribute("id", "ok");
        ok.setAttribute("type", "button");
        ok.setAttribute("value", "确定");
        ok.addEventListener("click", (event) => {
            //点击确认按钮就移除这个弹窗
            popUp.parentNode.removeChild(popUp);
        });
        //取消按钮
        let cancel = document.createElement("input");
        cancel.setAttribute("id", "cancel");
        cancel.setAttribute("type", "button");
        cancel.setAttribute("value", "取消");
        //添加DOM
        popUp.appendChild(ok);
        popUp.appendChild(cancel);
        popUp.appendChild(contentDiv);
    }
}